fix(evaluators): add Luna API URL override#237
Draft
abhinav-galileo wants to merge 6 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
- Verify TLS against an optional CA bundle (ca_file arg or GALILEO_LUNA_CA_FILE) so internal API endpoints with internally-issued certificates work in internal auth mode. - Bound connection pooling (keepalive expiry 1s, connection limits) so requests do not reuse sockets the server already closed, and retry the idempotent scorer invoke once on connection errors. - Deprecate GALILEO_LUNA_AUTH_MODE; the auth mode is inferred from the configured credential, and setting both credentials remains an explicit error. - Trim whitespace when resolving API base URLs from the environment. - Update the Luna example README and cover URL precedence, TLS, retry, and deprecation with tests.
| value = os.getenv("GALILEO_LUNA_AUTH_MODE") | ||
| if value is None or value.strip() == "": | ||
| return None | ||
| warnings.warn( |
Contributor
There was a problem hiding this comment.
warnings.warn(..., DeprecationWarning) is filtered out by default in production Python, so an operator still relying on GALILEO_LUNA_AUTH_MODE likely never sees the notice. Consider also emitting logger.warning(...) so the deprecation actually surfaces in logs (the class already logs the selected auth mode right after).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GALILEO_LUNA_API_URLbeforeGALILEO_API_URLfor Luna scorer calls; this URL is optional and only needed for custom scorer API endpoints.GALILEO_API_SECRET_KEY; internal-auth deployments inject it.Checks
make testmake lintmake typecheckuv run --with ruff ruff check --config pyproject.toml examples/galileo_luna